package cn.sh.yhk.controller;

import cn.sh.yhk.configure.security.MyUserDetails;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * Created with IDEA
 * author:Yhk
 * Date:2019/1/10
 * Time:3:02 PM
 */
public abstract class BaseController {

    public MyUserDetails getLoginCurrenterUser() {
        return (MyUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
